import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
import { LOGIN_COOKIE_KEY } from '@/constants/index';
import { thyCookie, thyUrl } from '@thyiad/util';

const Welcome = () => import('./pages/welcome/index.vue');
const Entry = () => import('./pages/entry/index.vue');

const routes: RouteRecordRaw[] = [
    {
        path: '/',
        redirect: '/welcome',
        strict: true,
    },
    {
        path: '/welcome',
        component: Welcome,
        meta: {
            enterActive: 'animate__animated animate__zoomIn animate__faster',
            leaveActive: 'animate__animated animate__zoomOut animate__fastest',
        },
    },
    {
        path: '/entry',
        component: Entry,
        meta: {
            enterActive: 'animate__animated animate__zoomIn animate__faster',
            leaveActive: 'animate__animated animate__zoomOut animate__fastest',
        },
    },
];

const router = createRouter({
    history: createWebHashHistory(),
    routes,
    // scrollBehavior(to, from, savedPosition) {
    //   return { top: 0 }
    // },
});

// router.beforeEach((to, from, next) => {
//     next();
// })

export default router;
